<%-- 
    Document   : createInvitation
    Created on : 24-jun-2013, 18:58:20
    Author     : juli
--%>

<%@page import="beans.Dao"%>
<%@page import="model.Room"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <script type="text/javascript"  src="Scrips/validaInv.js">
        </script>
    </head>
    <body id="css-zen-garden">
        <div class="page-wrapper">
            <section class="intro"> 
                <div class="preamble" id="zen-resources">
                    <h1>Create a new Invitation</h1>

                    <p><h2>${sessionScope['error']}</h2></p>
                     <form onsubmit="return comprobarI();" action="CreateInvitation" method="post">
                         <p><label id="label_name" for="name">
                                                Name
                             </label><input type="text" name="name" id="name"></p>
                         <p><textarea NAME="description" ROWS=4 COLS=54>Description of the Meeting...</textarea></p>
                         <p><textarea NAME="guests" ROWS=4 COLS=54>Guests...</textarea></p>
                         <p>Select a room by name:</p><br>
                         <%
                                 List<Room> lista = Dao.getRooms();
                                 out.println("<select name='room'>");
                                 out.println("<option selected>--- Select a room ---</option>");

                                   for (int i=0;i<lista.size();i++)
                                   {
                                      out.println("<option>"+lista.get(i).getName()+"</option>");
                                   }
                                 out.println("</select>");
                          %>
                       <p> Select day of the Meeting: 
                           <label id="label_day" for="day">
                             </label><input type="text" name="day" id="day">
                             <label id="label_month" for="month">
                             </label><input type="text" name="month" id="month">
                           <label id="label_year" for="year">
                             </label><input type="text" name="year" id="year">
                       </p>
                       <p><input type="submit" value="Accept"></p>
                     </form>
                  </div>
            </section>
        </div>
    </body>
</html>
